from django.db import models
from datetime import datetime


# Create your models here.
class ApiCase(models.Model):
    case_name = models.CharField(max_length=255, verbose_name="用例名称")
    case_path = models.CharField(max_length=255, verbose_name="用例地址")
    create_time = models.DateTimeField(default=datetime.now, verbose_name="创建时间")
    execute_time = models.DateTimeField(null=True, verbose_name="执行时间")
    status = models.CharField(max_length=10, verbose_name="0=未执行 1=已执行 3=已关闭", default=0)
    functional = models.CharField(max_length=255, verbose_name="所属模块", default="2")


class ApiReport(models.Model):
    report_path = models.CharField(max_length=255, verbose_name="报告地址")
    case = models.ForeignKey(ApiCase, on_delete=models.CASCADE, verbose_name="关联的case报告")
    create_time = models.DateTimeField(default=datetime.now, verbose_name="创建时间")
